home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / misc / libx11inc.lha / X11 / Xm / BaseClassP.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-13  |  6.3 KB  |  201 lines

  1. /* 
  2.  * (c) Copyright 1989, 1990, 1991, 1992 OPEN SOFTWARE FOUNDATION, INC.
  3.  * ALL RIGHTS RESERVED
  4. */ 
  5. /*   $RCSfile: BaseClassP.h,v $ $Revision: 1.13 $ $Date: 92/05/14 12:47:56 $ */
  6. /*
  7. *  (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 HEWLETT-PACKARD COMPANY */
  8. /*
  9. *  (c) Copyright 1989, 1990 DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
  10. /*
  11. *  (c) Copyright 1988 MASSACHUSETTS INSTITUTE OF TECHNOLOGY  */
  12. #ifndef _XmBaseClassP_h
  13. #define _XmBaseClassP_h
  14.  
  15. #ifndef _XmNO_BC_INCL
  16. #define _XmNO_BC_INCL
  17. #endif
  18.  
  19. #include <Xm/XmP.h>
  20.  
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24.  
  25.  
  26. #define _XmBCEPTR(wc)    ((XmBaseClassExt *)(&(((WidgetClass)(wc))\
  27.                         ->core_class.extension)))
  28. #define _XmBCE(wc)    ((XmBaseClassExt)(((WidgetClass)(wc))\
  29.                         ->core_class.extension))
  30. #define _XmGetBaseClassExtPtr(wc, owner) \
  31.     ((_XmBCE(wc) && (((_XmBCE(wc))->record_type) == owner)) \
  32.         ? _XmBCEPTR(wc) : ((XmBaseClassExt *) _XmGetClassExtensionPtr( \
  33.                 ((XmGenericClassExt *) _XmBCEPTR( wc)), owner)))
  34.  
  35. /* defines for 256 bit (at least) bit field
  36.  */
  37. #define _XmGetFlagsBit(field, bit) \
  38.               ((field[ (bit >> 3) ]) & (1 << (bit & 0x07)))
  39.  
  40. #define _XmSetFlagsBit(field, bit) \
  41.                (field[ (bit >> 3) ] |= (1 << (bit & 0x07)))
  42.  
  43.  
  44. #define _XmFastSubclassInit(wc, bit_field) \
  45.     {     XmBaseClassExt * _Xm_fastPtr ; \
  46.         if(    _Xm_fastPtr = _XmGetBaseClassExtPtr( wc, XmQmotif)    ) \
  47.         _XmSetFlagsBit((*_Xm_fastPtr)->flags, bit_field) ; \
  48.         }
  49. #define _XmIsFastSubclass(wc, bit) \
  50.       (_XmGetFlagsBit( ((*_XmGetBaseClassExtPtr((wc),XmQmotif))->flags), bit) \
  51.                               ? TRUE : FALSE)
  52.  
  53. #define XmBaseClassExtVersion 2L
  54.  
  55.  
  56. #ifdef _NO_PROTO
  57. typedef Cardinal (*XmGetSecResDataFunc) ();
  58. #else
  59. typedef Cardinal (*XmGetSecResDataFunc)( WidgetClass,
  60.                         XmSecondaryResourceData **);
  61. #endif
  62.  
  63. typedef struct _XmObjectClassExtRec{
  64.     XtPointer         next_extension;    
  65.     XrmQuark         record_type;    
  66.     long         version;    
  67.     Cardinal         record_size;    
  68. }XmObjectClassExtRec, *XmObjectClassExt;
  69.  
  70. typedef struct _XmGenericClassExtRec{
  71.     XtPointer         next_extension;    
  72.     XrmQuark         record_type;    
  73.     long         version;    
  74.     Cardinal         record_size;    
  75. }XmGenericClassExtRec, *XmGenericClassExt;
  76.  
  77. typedef struct _XmWrapperDataRec{
  78.     struct _XmWrapperDataRec *next;
  79.     WidgetClass        widgetClass;
  80.     XtInitProc        initializeLeaf;
  81.     XtSetValuesFunc    setValuesLeaf;
  82.     XtArgsProc        getValuesLeaf;
  83.     XtRealizeProc    realize;
  84.     XtWidgetClassProc    classPartInitLeaf;
  85.     XtWidgetProc    resize;
  86.     XtGeometryHandler   geometry_manager;
  87. }XmWrapperDataRec, *XmWrapperData;
  88.  
  89. typedef struct _XmBaseClassExtRec{
  90.     XtPointer         next_extension;    
  91.     XrmQuark         record_type;    
  92.     long         version;    
  93.     Cardinal         record_size;    
  94.     XtInitProc        initializePrehook;
  95.     XtSetValuesFunc     setValuesPrehook;
  96.     XtInitProc        initializePosthook;
  97.     XtSetValuesFunc     setValuesPosthook;
  98.     WidgetClass        secondaryObjectClass;
  99.     XtInitProc        secondaryObjectCreate;
  100.     XmGetSecResDataFunc    getSecResData;
  101.     unsigned char    flags[32];
  102.     XtArgsProc        getValuesPrehook;
  103.     XtArgsProc        getValuesPosthook;
  104.     XtWidgetClassProc    classPartInitPrehook;
  105.     XtWidgetClassProc    classPartInitPosthook;
  106.     XtResourceList    ext_resources;
  107.     XtResourceList    compiled_ext_resources;
  108.     Cardinal        num_ext_resources;
  109.     Boolean        use_sub_resources;
  110.     XmWidgetNavigableProc widgetNavigable;
  111.     XmFocusChangeProc    focusChange;
  112.     XmWrapperData    wrapperData;
  113. }XmBaseClassExtRec, *XmBaseClassExt;
  114.  
  115. typedef struct _XmWidgetExtDataRec{
  116.     Widget        widget;
  117.     Widget        reqWidget;
  118.     Widget        oldWidget;
  119. }XmWidgetExtDataRec, *XmWidgetExtData;
  120.  
  121. externalref XrmQuark        XmQmotif;
  122. externalref int     _XmInheritClass;
  123.  
  124.  
  125. /********    Private Function Declarations    ********/
  126. #ifdef _NO_PROTO
  127.  
  128. extern Boolean _XmIsSlowSubclass() ;
  129. extern XmGenericClassExt * _XmGetClassExtensionPtr() ;
  130. extern void _XmPushWidgetExtData() ;
  131. extern void _XmPopWidgetExtData() ;
  132. extern XmWidgetExtData _XmGetWidgetExtData() ;
  133. extern void _XmFreeWidgetExtData() ;
  134. extern void _XmBaseClassPartInitialize() ;
  135. extern void _XmInitializeExtensions() ;
  136. extern Boolean _XmIsStandardMotifWidgetClass() ;
  137. extern Cardinal _XmSecondaryResourceData() ;
  138. extern void _XmTransformSubResources() ;
  139.  
  140. #else
  141.  
  142. extern Boolean _XmIsSlowSubclass( 
  143.                         WidgetClass wc,
  144.                         unsigned int bit) ;
  145. extern XmGenericClassExt * _XmGetClassExtensionPtr( 
  146.                         XmGenericClassExt *listHeadPtr,
  147.                         XrmQuark owner) ;
  148. extern void _XmPushWidgetExtData( 
  149.                         Widget widget,
  150.                         XmWidgetExtData data,
  151. #if NeedWidePrototypes
  152.                         unsigned int extType) ;
  153. #else
  154.                         unsigned char extType) ;
  155. #endif /* NeedWidePrototypes */
  156. extern void _XmPopWidgetExtData( 
  157.                         Widget widget,
  158.                         XmWidgetExtData *dataRtn,
  159. #if NeedWidePrototypes
  160.                         unsigned int extType) ;
  161. #else
  162.                         unsigned char extType) ;
  163. #endif /* NeedWidePrototypes */
  164. extern XmWidgetExtData _XmGetWidgetExtData( 
  165.                         Widget widget,
  166. #if NeedWidePrototypes
  167.                         unsigned int extType) ;
  168. #else
  169.                         unsigned char extType) ;
  170. #endif /* NeedWidePrototypes */
  171. extern void _XmFreeWidgetExtData( 
  172.                         Widget widget) ;
  173. extern void _XmBaseClassPartInitialize( 
  174.                         WidgetClass wc) ;
  175. extern void _XmInitializeExtensions( void ) ;
  176. extern Boolean _XmIsStandardMotifWidgetClass( 
  177.                         WidgetClass wc) ;
  178. extern Cardinal _XmSecondaryResourceData( 
  179.                         XmBaseClassExt bcePtr,
  180.                         XmSecondaryResourceData **secResDataRtn,
  181.                         XtPointer client_data,
  182.                         String name,
  183.                         String class_name,
  184.                         XmResourceBaseProc basefunctionpointer) ;
  185. extern void _XmTransformSubResources( 
  186.                         XtResourceList comp_resources,
  187.                         Cardinal num_comp_resources,
  188.                         XtResourceList *resources,
  189.                         Cardinal *num_resources) ;
  190.  
  191. #endif /* _NO_PROTO */
  192. /********    End Private Function Declarations    ********/
  193.  
  194.  
  195. #ifdef __cplusplus
  196. }  /* Close scope of 'extern "C"' declaration which encloses file. */
  197. #endif
  198.  
  199. #endif /* _XmBaseClassP_h */
  200. /* DON'T ADD ANYTHING AFTER THIS #endif */
  201.